<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>企业级 Maven 私服搭建指南</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            min-height: 100vh;
        }
        
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        
        .card-hover {
            transition: all 0.3s ease;
        }
        
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 40px rgba(0,0,0,0.1);
        }
        
        .text-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }
        
        .code-block {
            background: #1e1e1e;
            color: #d4d4d4;
            border-radius: 8px;
            padding: 1.5rem;
            overflow-x: auto;
            position: relative;
        }
        
        .code-block::before {
            content: attr(data-lang);
            position: absolute;
            top: 0.5rem;
            right: 0.5rem;
            font-size: 0.75rem;
            color: #858585;
            text-transform: uppercase;
        }
        
        .step-number {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            width: 2.5rem;
            height: 2.5rem;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            flex-shrink: 0;
        }
        
        .feature-icon {
            background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }
        
        .section-divider {
            height: 2px;
            background: linear-gradient(to right, transparent, #e0e0e0, transparent);
            margin: 3rem 0;
        }
        
        @keyframes float {
            0% { transform: translateY(0px); }
            50% { transform: translateY(-10px); }
            100% { transform: translateY(0px); }
        }
        
        .float-animation {
            animation: float 3s ease-in-out infinite;
        }
    </style>
</head>
<body>
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-6">
        <div class="max-w-6xl mx-auto text-center">
            <div class="mb-6 float-animation">
                <i class="fas fa-server text-6xl opacity-80"></i>
            </div>
            <h1 class="text-5xl md:text-6xl font-bold mb-6">企业级 Maven 私服搭建指南</h1>
            <p class="text-xl md:text-2xl opacity-90 max-w-3xl mx-auto leading-relaxed">
                使用 Nexus Repository Manager 构建高效、稳定的依赖管理体系
            </p>
            <div class="mt-10 flex flex-wrap justify-center gap-4">
                <div class="bg-white bg-opacity-20 backdrop-blur-sm rounded-lg px-6 py-3">
                    <i class="fas fa-rocket mr-2"></i>加速构建
                </div>
                <div class="bg-white bg-opacity-20 backdrop-blur-sm rounded-lg px-6 py-3">
                    <i class="fas fa-shield-alt mr-2"></i>私有组件管理
                </div>
                <div class="bg-white bg-opacity-20 backdrop-blur-sm rounded-lg px-6 py-3">
                    <i class="fas fa-sync-alt mr-2"></i>版本控制
                </div>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <main class="max-w-6xl mx-auto px-6 py-12">
        <!-- Introduction -->
        <section class="bg-white rounded-2xl shadow-xl p-8 mb-12 card-hover">
            <div class="flex items-start space-x-4">
                <div class="text-4xl feature-icon">
                    <i class="fas fa-lightbulb"></i>
                </div>
                <div class="flex-1">
                    <h2 class="text-2xl font-bold mb-4 text-gray-800">为什么需要 Maven 私服？</h2>
                    <p class="text-gray-600 leading-relaxed text-lg">
                        在企业级 Java 开发中，项目通常需要依赖大量第三方库和内部私有组件。直接使用 Maven 中央仓库可能存在网络延迟、版本不稳定等问题，而将所有依赖都打包进项目也不现实。因此，企业通常会搭建私有 Maven 仓库，既可以加速构建，又能管理自研组件。Nexus Repository Manager 是最常用的 Maven 私服之一。
                    </p>
                </div>
            </div>
        </section>

        <!-- Nexus Features -->
        <section class="mb-12">
            <h2 class="text-3xl font-bold mb-8 text-center text-gradient">Nexus 核心功能</h2>
            <div class="grid md:grid-cols-3 gap-6">
                <div class="bg-white rounded-xl shadow-lg p-6 card-hover">
                    <div class="text-3xl mb-4 text-purple-600">
                        <i class="fas fa-cloud-download-alt"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-2">代理中央仓库</h3>
                    <p class="text-gray-600">缓存远程依赖，大幅提升构建速度，减少网络带宽消耗</p>
                </div>
                <div class="bg-white rounded-xl shadow-lg p-6 card-hover">
                    <div class="text-3xl mb-4 text-pink-600">
                        <i class="fas fa-lock"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-2">私有组件存储</h3>
                    <p class="text-gray-600">安全存储企业内部组件，保护知识产权，确保代码安全</p>
                </div>
                <div class="bg-white rounded-xl shadow-lg p-6 card-hover">
                    <div class="text-3xl mb-4 text-indigo-600">
                        <i class="fas fa-code-branch"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-2">版本统一管理</h3>
                    <p class="text-gray-600">集中管理所有依赖版本，避免版本冲突，提高项目稳定性</p>
                </div>
            </div>
        </section>

        <div class="section-divider"></div>

        <!-- Installation Steps -->
        <section class="mb-12">
            <h2 class="text-3xl font-bold mb-8 text-center">安装部署步骤</h2>
            
            <!-- Step 1 -->
            <div class="bg-white rounded-xl shadow-lg p-8 mb-6 card-hover">
                <div class="flex items-start space-x-4">
                    <div class="step-number">1</div>
                    <div class="flex-1">
                        <h3 class="text-2xl font-semibold mb-4">下载 Nexus</h3>
                        <p class="text-gray-600 mb-4">Nexus 提供了开源版 OSS（免费）和专业版（收费）。这里我们使用 <strong>Nexus OSS</strong>。</p>
                        <div class="bg-gray-50 rounded-lg p-4">
                            <p class="mb-2"><i class="fas fa-download text-purple-600 mr-2"></i>官方下载地址：</p>
                            <a href="https://www.sonatype.com/products/nexus-repository" class="text-purple-600 hover:text-purple-800 underline">
                                https://www.sonatype.com/products/nexus-repository
                            </a>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Step 2 -->
            <div class="bg-white rounded-xl shadow-lg p-8 mb-6 card-hover">
                <div class="flex items-start space-x-4">
                    <div class="step-number">2</div>
                    <div class="flex-1">
                        <h3 class="text-2xl font-semibold mb-4">启动 Nexus</h3>
                        <p class="text-gray-600 mb-4">解压下载的 ZIP 文件后，进入 <code class="bg-gray-100 px-2 py-1 rounded">nexus/bin</code> 目录：</p>
                        <div class="code-block" data-lang="shell">
                            <pre>./nexus start  # Linux/Mac
nexus.exe /run  # Windows</pre>
                        </div>
                        <p class="text-gray-600 mt-4">默认情况下，Nexus 运行在 <code class="bg-gray-100 px-2 py-1 rounded">http://localhost:8081</code></p>
                    </div>
                </div>
            </div>

            <!-- Step 3 -->
            <div class="bg-white rounded-xl shadow-lg p-8 mb-6 card-hover">
                <div class="flex items-start space-x-4">
                    <div class="step-number">3</div>
                    <div class="flex-1">
                        <h3 class="text-2xl font-semibold mb-4">配置管理员账户</h3>
                        <p class="text-gray-600 mb-4">首次启动后，访问 <code class="bg-gray-100 px-2 py-1 rounded">http://localhost:8081</code>，默认的管理员账户信息：</p>
                        <div class="bg-purple-50 rounded-lg p-4">
                            <p class="mb-2"><i class="fas fa-user text-purple-600 mr-2"></i><strong>用户名：</strong><code class="bg-white px-2 py-1 rounded">admin</code></p>
                            <p><i class="fas fa-key text-purple-600 mr-2"></i><strong>密码：</strong><code class="bg-white px-2 py-1 rounded">&lt;nexus-data&gt;/admin.password</code> 文件内的内容</p>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <div class="section-divider"></div>

        <!-- Repository Configuration -->
        <section class="mb-12">
            <h2 class="text-3xl font-bold mb-8 text-center">仓库配置架构</h2>
            
            <!-- Mermaid Diagram -->
            <div class="bg-white rounded-xl shadow-lg p-8 mb-8">
                <div class="mermaid">
                    graph TB
                        A[Maven 项目] -->|请求依赖| B[Nexus Group 仓库]
                        B --> C[Hosted 私有仓库]
                        B --> D[Proxy 代理仓库]
                        D -->|缓存| E[Maven 中央仓库]
                        F[开发者] -->|上传组件| C
                        
                        style A fill:#f9f,stroke:#333,stroke-width:2px
                        style B fill:#bbf,stroke:#333,stroke-width:2px
                        style C fill:#bfb,stroke:#333,stroke-width:2px
                        style D fill:#fbf,stroke:#333,stroke-width:2px
                        style E fill:#fbb,stroke:#333,stroke-width:2px
                        style F fill:#ff9,stroke:#333,stroke-width:2px
                </div>
            </div>

            <!-- Repository Types -->
            <div class="grid md:grid-cols-3 gap-6">
                <div class="bg-gradient-to-br from-purple-50 to-pink-50 rounded-xl p-6">
                    <h3 class="text-xl font-semibold mb-3 flex items-center">
                        <i class="fas fa-globe text-purple-600 mr-3"></i>
                        Proxy 代理仓库
                    </h3>
                    <p class="text-gray-700">代理远程仓库，加速访问，减少外网依赖</p>
                </div>
                <div class="bg-gradient-to-br from-blue-50 to-indigo-50 rounded-xl p-6">
                    <h3 class="text-xl font-semibold mb-3 flex items-center">
                        <i class="fas fa-home text-blue-600 mr-3"></i>
                        Hosted 宿主仓库
                    </h3>
                    <p class="text-gray-700">存储企业私有构件，保护核心资产</p>
                </div>
                <div class="bg-gradient-to-br from-green-50 to-teal-50 rounded-xl p-6">
                    <h3 class="text-xl font-semibold mb-3 flex items-center">
                        <i class="fas fa-layer-group text-green-600 mr-3"></i>
                        Group 仓库组
                    </h3